const fs = require('fs')
const path = require('path')

const router = require('koa-router')()

const { MANAGE_BASEROUTER } = require(path.join(__dirname, '../config/default'))

const { verifyToken } = require(path.join(__dirname, '../middleware/index'))

const {
  createUpImg,
  findImg,
  delImg
} = require(path.join(__dirname, '../routerHandle/managementHandle/bgImg'))

// 上传图片  /api/manage
router.post(MANAGE_BASEROUTER + '/upImg', verifyToken, createUpImg)

// 查询图片
router.get(MANAGE_BASEROUTER + '/findImg', verifyToken, findImg)

// 删除图片
router.post(MANAGE_BASEROUTER + '/delImg', verifyToken, delImg)

module.exports = router